package com.example.helloword.controller;

import com.example.helloword.dto.EnumCity;
import com.example.helloword.dto.Person;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RequestMapping("/mvc")
@RestController
@Slf4j
public class MvcConfigController {
    @PostMapping("/debug")
    public Person debug(@RequestBody Person person) {
        person.setCityNum(EnumCity.NINGBO);
        person.setCityStr(EnumCity.NINGBO);
        log.info("{}", person);
        return person;
    }
}
